// const loginChecker = function (req, res, next) {
//     if (!req.cookies["username"]) {
//         res.send("请先登录!");
//     } else {
//         next();
//     }
// };

const loginChecker = function (req, res, next) {
    console.log("req.session", req.session);
    if (!req.session["username"]) {
        res.send("请先登录!");
    } else {
        next();
    }
};

module.exports = {
    loginChecker,
};
